ci: run unittests only on python and dependency change#1738
ci: run unittests only on python and dependency change#1738bearomorphism merged 1 commit intomasterfrom
Conversation
30aa825 to
59839b5
Compare
|
oh... this needs extra care on the setting side. I don't have a clear idea how to cater this change yet 🤔 |
|
It seems that I don't have the permission to read branch protection rules. |
|
Waiting for adjusting branch protection rules |
|
The problem is that it's not possible to reflect that condition in the branch protection rules. So not sure if it's worth it (given tests are now also running faster) |
|
Agree. Now I prefer not to touch the branch protection rules. Potential solution by ChatGPT: Behavior:
|
|
Thanks for the action! 🙏🏼 I'll keep it, this is something I often need. However this wouldn't solve the branch protection issue. name: CI
on:
pull_request:
jobs:
detect_changes:
runs-on: ubuntu-latest
outputs:
relevant: ${{ steps.filter.outputs.relevant }}
steps:
- uses: actions/checkout@v4
- id: filter
uses: dorny/paths-filter@v3
with:
filters: |
relevant:
- "src/**"
- "tests/**"
- ".github/workflows/**"
python-check:
needs: detect_changes
if: ${{ needs.detect_changes.outputs.relevant == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "Run build/test here"
success:
needs: [python-check]
# Force to run when python-check has been skipped
# Skipped if python-check failed
if: ${{ needs.detect_changes.outputs.relevant != 'true' && always() || !failure() }}
runs-on: ubuntu-latest
steps:
- run: echo "CI Success"This way we can use
However, for this to be complete, you will need to split out the linting part. |
|
Yep, I think what @noirbizarre suggests is better. We can't configurate the branch protection rule that way |
59839b5 to
9e48eef
Compare
9e48eef to
693c5db
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1738 +/- ##
=======================================
Coverage 97.88% 97.88%
=======================================
Files 60 60
Lines 2606 2606
=======================================
Hits 2551 2551
Misses 55 55 ☔ View full report in Codecov by Sentry. |
693c5db to
6bf82de
Compare
|
I cannot access the branch protection rule, so the latest iteration is based on my assumption that Please let me know if there is a cleaner approach. |
6bf82de to
42c592b
Compare
Closes #1697
Expected behavior
The unittest workflow should only run when there is workflow change,
commitizen/**change ortests/**change.Steps to test
See #1774
Trigger jobs: